﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CarsListGrid.ascx.cs" Inherits="CarRental.Control.User.CarsListGrid" %>

    <asp:GridView runat="server" ID="CarsGridView" AutoGenerateColumns="false" OnRowCommand="RowCommandHandler">
        <Columns>
          <asp:BoundField HeaderText="ID" DataField="Id" ReadOnly="true"></asp:BoundField>
          <asp:BoundField HeaderText="Numer rejestracyjny" DataField="RegistrationNumber"></asp:BoundField>
          <asp:BoundField HeaderText="Marka" DataField="Producer" />
          <asp:BoundField HeaderText="Model" DataField="Model" />
          <asp:BoundField HeaderText="Data produkcji" DataField="ProductionYear" DataFormatString="{0:dd-MM-yyyy}"></asp:BoundField>
          <asp:TemplateField HeaderText="Aktywny">
            <EditItemTemplate>
                <asp:CheckBox ID="CheckBoxIsActive" runat="server" Checked='<%# Bind("IsActive") %>'></asp:CheckBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:CheckBox ID="CheckBoxIsActive" runat="server" Checked='<%# Bind("IsActive") %>' Enabled="false"></asp:CheckBox>
            </ItemTemplate>
          </asp:TemplateField>
          <asp:BoundField HeaderText="Data dodania" DataField="AddDate" DataFormatString="{0:dd-MM-yyyy}" ReadOnly="true"></asp:BoundField>
          
          <asp:TemplateField HeaderText="Akcja">
            <ItemTemplate>
                <asp:LinkButton ID="btnCarEdit" runat="server" CommandArgument='<%# Eval("Id") %>' CommandName="EditCar" Text="Edycja" />
            </ItemTemplate>
          </asp:TemplateField>
          <%--<asp:CommandField ShowEditButton="True" ShowDeleteButton="True" EditText="Edytuj" CancelText="Anuluj" UpdateText="Zapisz" DeleteText="Usuń"></asp:CommandField>--%>
        </Columns>
    </asp:GridView>

